﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["login"] == null)
        {
            Response.Redirect("~/loginAdmin.aspx");
        }
        else
        {
            String q = Request.Params["page"];
            //try
            //{
            if (q != "")
            {
                title.Text = "Quản lý " + q.Substring(2);
                Control control = LoadControl(q + ".ascx");
                Body.Controls.Add(control);
            }
            //}
            //catch (Exception ex)
            //{
            //    title.Text = "Co loi";
            //}
        }
    }

    protected void btnSignOut_Click(object sender, EventArgs e)
    {
        Session["login"] = null;
        Security.Logout();
        Response.Redirect("~/loginAdmin.aspx");
    }
}